import axios from '../src/axios.js';
import testAxios from './testAxios.js';

axios.defaults.baseURL = './index.html';

console.dir(axios);

const {cancel, token} = axios.getCancelAndToken();

const btnStart = document.createElement('button');
btnStart.innerText = '开始请求';

btnStart.onclick = function () {
  testAxios();
};
document.documentElement.append(btnStart);

const btnAbort = document.createElement('button');
btnAbort.innerText = '点击就阻止';

btnAbort.onclick = function () {
  cancel('btnAbort 阻止了请求');
};
document.documentElement.append(btnAbort);
